// 数字、字母、中划线和下划线
export const isNormalName = new RegExp('^[a-zA-Z0-9_-]{1,}$')

// 账户 命名规范：数字、字母、下划线、中划线、@符号组成，以数字或字母开头
export const isAccountName = new RegExp('^([a-zA-Z0-9]{1,})([a-zA-Z0-9_\\-@]{1,})$')

// IP:Port
export const isIPHost = new RegExp('^((\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5]){1}\:([0-9]|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-4]\\d{4}|65[0-4]\\d{2}|655[0-2]|6553[0-5])$')

// http or https 开头的域名
export const isBasicUrl = new RegExp('^http[s]{0,1}:\\/\\/')
// 整数
export const isInt = new RegExp('^-?\\d+$')

// 浮点数
export const isFloat = new RegExp('^(-?\\d+)(\\.\\d+)$')

// 国内手机号位数、开头简单校验
export const isTel = new RegExp('^1[0-9]{10}$')

// AgentId
export const isAgentId = new RegExp('^\\d{1,}$')

// 域名正则
export const HOST_REG = new RegExp('^(?=^.{3,255}$)(http(s)?:\\/\\/)?(www\\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\\d+)*(\\/\\w+\\.\\w+)*([\?&]\\w+=\\w*)*$')
// 端口正则
export const PORT_REG = new RegExp('^([0-9]|[1-9]\\d|[1-9]\\d{2}|[1-9]\\d{3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$')

export const databaseCol = new RegExp('(^_([a-z0-9]_?)*$)|(^[a-z](_?[a-z0-9])*_?$)')

// url正则
export const URL_REG = new RegExp('^(((ht|f)tps?):\\/\\/)?[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])?$');

// 邮箱
export const EMAIL_REG = new RegExp('^([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+\\.[a-zA-Z]{2,3}$');

